/*
* reducer 数据处理
* */
import {type} from '../action'

const initialState = {
    menuName: '首页',
    cityId: 1000,
}

export default (state = initialState, action) => {
    console.log('action')
    console.log(action)
    switch (action.type) {
        case type.SWITCH_MENU:
            console.log('switch', action.menuName)
            return {
                ...state,//保留旧的数据
                menuName: action.menuName
            }
            break;
        default:
            return {
                ...state
            }
            break;
    }
}
